package com.cn.system.mapper;

import java.util.List;

/**
 * @Classname IBaseCommMapper
 * @Description base mapper
 * @Date 2020/3/16 13:59
 * @Created by 80021713
 */
public interface IBaseCommMapper<T> {
  /**
   *  gain data from unique databases;
   * @return if database exist with select condition match, return from unique data
   * else return null;
   */
  public T get(String id);

  /**
   * gain condition from database;
   * @param t entity
   * @return
   */
  public List<T> list(T t);


  /**
   * According to entity object from databases update data.
   * @param t entity
   * @return
   */
  public int update(T t);

  /**
   * According to unique flag from databases delete data.
   * @param id unique flag
   */
  public int delete(String id);

  /**
   * add data to databases.
   * @param t entity object
   * @return
   */
  public int add(T t);

  public List<T> page(T t);
}
